<?php
// Tim'Roster
// Copyright (c) 2011 Nicolas Nallet <aspgic2@gmail.com>
//
// This file is part of Tim'Roster.
//
// Tim'Roster is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Tim'Roster is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

class Enum_Item_Race{

    const COMMON_ITEM_RACE_ID = 0;
    const COMMON_ITEM_RACE_LABEL = 'common';

    const FYROS_ITEM_RACE_ID = 1;
    const FYROS_ITEM_RACE_LABEL = 'fyros';

    const MATIS_ITEM_RACE_ID = 2;
    const MATIS_ITEM_RACE_LABEL = 'matis';

    const TRYKER_ITEM_RACE_ID = 3;
    const TRYKER_ITEM_RACE_LABEL = 'tryker';

    const ZORAI_ITEM_RACE_ID = 4;
    const ZORAI_ITEM_RACE_LABEL = 'zorai';

    /**
     * (PHP 5)<br/>
     * Convert api race code to race id
     * @param string $value
     * @return int
     */
    public static function convert_api_code_to_id($value){
        switch ($value){
            case 'f' : return Enum_Item_Race::FYROS_ITEM_RACE_ID;
            case 'm' : return Enum_Item_Race::MATIS_ITEM_RACE_ID;
            case 't' : return Enum_Item_Race::TRYKER_ITEM_RACE_ID;
            case 'z' : return Enum_Item_Race::ZORAI_ITEM_RACE_ID;
            default : return Enum_Item_Race::COMMON_ITEM_RACE_ID;
        }
    }

    /**
     * (PHP 5)<br/>
     * Convert race id to race label
     * @param int $value
     * @return string
     */
    public static function convert_id_to_label($value){
        switch ($value){
            case 0 : return Enum_Item_Race::COMMON_ITEM_RACE_LABEL;
            case 1 : return Enum_Item_Race::FYROS_ITEM_RACE_LABEL;
            case 2 : return Enum_Item_Race::MATIS_ITEM_RACE_LABEL;
            case 3 : return Enum_Item_Race::TRYKER_ITEM_RACE_LABEL;
            case 4 : return Enum_Item_Race::ZORAI_ITEM_RACE_LABEL;
        }
    }
}

?>
